using SeataNet.Core.AT.UndoLog;
using System.Data.Common;

namespace SeataNet.Core.Database
{
    /// <summary>
    /// 表元数据缓存接口
    /// </summary>
    public interface ITableMetaCache
    {
        /// <summary>
        /// 获取表元数据
        /// </summary>
        Task<TableMeta> GetTableMetaAsync(DbConnection connection, string tableName);

        /// <summary>
        /// 刷新表元数据
        /// </summary>
        Task RefreshTableMetaAsync(DbConnection connection, string tableName);

        /// <summary>
        /// 清除缓存
        /// </summary>
        void Clear();

        /// <summary>
        /// 清除指定表的缓存
        /// </summary>
        void Clear(string tableName);
    }
}
